<@master template="master/master-loan"  title="审批管理">
<div class="detaiTab detaiTab1">
	<form  action="/wf/queryTask" class="clearfix" method="GET" id="userTaskParam" >
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td class="bg" align="right" width="15%">流程大类:</td>
			     <td>
					<select name="catagory" id="catagory" style="width:150px;">
						<option value="">--请选择--</option>
						<#list catagoryList as catagory>
							<option value="${catagory.code}" <#if catagory.code==userTaskParam.catagory>selected="selected"</#if>>${catagory.name}</option>
						</#list>
					</select>
			    </td>
			  	<td class="bg" align="right" width="15%">业务单号:</td>
			    <td>
					<input  class="tabInp"  type="text"  name="referCode" value="${userTaskParam.referCode}" placeholder="单号" />
			    </td>
		    </tr>
			<tr>
				<td class="bg" align="right" width="15%">流程类型:</td>
			    <td>
					<select name="processType" id="processType" style="width:150px;">
						<option value="">--请选择--</option>
						<#list processTypeList as processType>
							<option value="${processType.code}" <#if processType.code==userTaskParam.processType>selected="selected"</#if>>${processType.name}</option>
						</#list>
					</select>
			    </td>
			    <td class="bg" align="right" width="15%">流程编号:</td>
			    <td>
					<input  class="tabInp"  type="text" name="taskCode" value="${userTaskParam.taskCode}" placeholder="流程编号" />
			    </td>
	        </tr>
	        
	        <tr>
	        	<td class="bg" align="right" width="15%">流程发起人:</td>
			     <td>
					<input  class="tabInp"  type="text" name="appliedbyName" value="${userTaskParam.appliedbyName}" placeholder="流程发起人" />
			    </td>
        		<td class="bg" align="right" width="15%">摘要:</td>
			     <td>
					<input  class="tabInp"  type="text" name="lender" value="${userTaskParam.lender}" placeholder="摘要信息，如借款" />
			    </td>
	         </tr>
	        
	        <@permission permissionName="queryAll">
		        <tr>
	        		<td class="bg" align="right" width="15%">节点处理人:</td>
				     <td>
						<input  class="tabInp"  type="text" name="auditorName" value="${userTaskParam.auditorName}" placeholder="节点处理人" />
				    </td>
		      		<td class="bg" align="right" width="15%">查询全部:</td>
		      		<td><input type="checkbox" value="true" name="queryAll" <#if userTaskParam.queryAll==true>checked="checked"</#if>></td>
		         </tr>
	        </@permission>
	        
	        <tr>
	        	<td class="bg" align="right" width="15%">节点名称:</td>
			     <td colspan="3">
					<input  class="tabInp"  type="text" name="pnodeName" value="${userTaskParam.pnodeName}" placeholder="节点名称" />
			    </td>
	        </tr>
	       	<tr>
	           <td class="bg"></td>
	           <td colspan="3"><input type="submit" value="搜索" class="btn_auto_30 btn_blue" /></td>
	         </tr>
	    </table>
	    <input type="hidden" name="approvalStatus" value="${userTaskParam.approvalStatus}">
	</form>
</div>
<div class="dataBable mt20">
	<table width="100%" cellspacing="0" cellpadding="0" border="0">
		<thead>
			<#if userTaskParam.approvalStatus == 'UNDO'>
				<tr>
					<th>流程编号</th>
					<th>单号</th>
					<th>摘要</th>
					<th>流程类型</th>
					<th>流程节点</th>
					<th>发起机构</th>
					<th>流程发起人</th>
					<th>节点处理人</th>
					<th>备注</th>
				</tr>
			<#else>
				<tr>
					<th>流程编号</th>
					<th>单号</th>
					<th>摘要</th>
					<th>流程类型</th>
					<th>流程审批状态</th>
					<th>发起机构</th>
					<th>流程发起人</th>
				<#if userTaskParam.approvalStatus == 'UNDO'>
					<#--<th>当前节点开始时间</th>-->
					<th>节点处理人</th>
				<#else>
					<th>审批开始时间</th>
					<th>审批结束时间</th>
				</#if>
					<th>备注</th>
				</tr>
			</#if>
		</thead>
		<tbody>
			<#if page.data?? && page.data?size gt 0>
				<#list page.data as item>
					<#if userTaskParam.approvalStatus == 'UNDO'>
						<tr <#if item_index%2!=0 >class="bg"</#if>>
							<td class="txtH">
							<#if item.nodeOvertime?? && (.now > item.nodeOvertime?datetime)>
								<img src="<@cdn value='/images/o2o-admin/hq.gif'/>" class="tam mr5" style="vertical-align: middle;">
							</#if>
							<#if item.referUrl == 'http://xxxx.eascs.com/getDetail'>
								<a  class="action-ajax-btn" href="javascript:void(0);" data-url="/wf/queryTask/${userTaskParam.approvalStatus}?referId=${item.referId}&nodeAuditorId=${item.nodeAuditorId}&approvalStatus=${param.approvalStatus}" data-ajax-wait-img="<@cdn value='img.wait'/>">${item.taskCode}</a></td>
							<#else>
								<#if item.referUrl?index_of("?") == -1>
									<a  class="action-ajax-btn" href="javascript:void(0);" data-url="${item.referUrl}?referId=${item.referId}&nodeAuditorId=${item.nodeAuditorId}&approvalStatus=${userTaskParam.approvalStatus}" data-ajax-wait-img="<@cdn value='img.wait'/>">${item.taskCode}</a></td>
								<#else>
									<a  class="action-ajax-btn" href="javascript:void(0);" data-url="${item.referUrl}&referId=${item.referId}&nodeAuditorId=${item.nodeAuditorId}&approvalStatus=${userTaskParam.approvalStatus}" data-ajax-wait-img="<@cdn value='img.wait'/>">${item.taskCode}</a></td>
								</#if>
							</#if>
							<td class="txtH">${item.referCode}</td>
							<td class="txtH">${item.appliedDes}</td>
							<td class="txtH">
								${item.processName}
							</td>
							<td class="txtH">${item.nodeName}</td>
							<td class="txtH">${item.orgName}</td>
							<td class="txtH">${item.appliedbyName}</td>
							<td class="txtH">${item.auditorName}</td>
							<td class="txtH" style="font-size:12px;"><div style="width:200px"><#noescape>${item.remark}</#noescape></div></td>
						</tr>
					<#else>
						<tr <#if item_index%2!=0 >class="bg"</#if>>
						<#if item.referUrl == 'http://xxxx.eascs.com/getDetail'>
								<td class="txtH"><a  class="action-ajax-btn" href="javascript:void(0);" data-url="/wf/queryTask/${userTaskParam.approvalStatus}?referId=${item.referId}&nodeAuditorId=${item.nodeAuditorId}&approvalStatus=${param.approvalStatus}" data-ajax-wait-img="<@cdn value='img.wait'/>">${item.taskCode}</a></td>
							<#else>
								<#if item.referUrl?index_of("?") == -1>
									<td class="txtH"><a  class="action-ajax-btn" href="javascript:void(0);" data-url="${item.referUrl}?referId=${item.referId}&nodeAuditorId=${item.nodeAuditorId}&approvalStatus=${userTaskParam.approvalStatus}" data-ajax-wait-img="<@cdn value='img.wait'/>">${item.taskCode}</a></td>
								<#else>
									<td class="txtH"><a  class="action-ajax-btn" href="javascript:void(0);" data-url="${item.referUrl}&referId=${item.referId}&nodeAuditorId=${item.nodeAuditorId}&approvalStatus=${userTaskParam.approvalStatus}" data-ajax-wait-img="<@cdn value='img.wait'/>">${item.taskCode}</a></td>
								</#if>
							</#if>
							<td class="txtH">${item.referCode}</td>
							<td class="txtH">${item.appliedDes}</td>
							<td class="txtH">
								${item.processName}
							</td>
							<td class="txtH">
								<#if item.processStatus == 0>
									审批完成
								<#elseif item.processStatus == 1>
									已否决
								<#elseif item.processStatus == 2>
									处理中
								<#elseif item.processStatus == 3>
									已驳回
								<#elseif item.processStatus == 9>
									已关闭
								<#else>
								</#if>
							</td>
						<td class="txtH">${item.orgName}</td>
						<td class="txtH">${item.appliedbyName}</td>
						<#if userTaskParam.approvalStatus == 'UNDO'>
							<#--<td><#if item.auditorStartDate??>${item.auditorStartDate?string('yyyy-MM-dd HH:mm:ss')}</#if></td>-->
							<td class="txtH">${item.auditorName}</td>
						<#else>
							<td class="txtH"><#if item.auditorStime??>${item.auditorStime?string('yyyy-MM-dd HH:mm:ss')}</#if></td>
							<td class="txtH"><#if item.auditorEtime??>${item.auditorEtime?string('yyyy-MM-dd HH:mm:ss')}</#if></td>
						</#if>
						<td class="txtH" style="font-size:12px;"><div style="width:200px"><#noescape>${item.remark}</#noescape></div></td>
						</tr>
					</#if>
				</#list>
			<#else>
				<tr><td colspan="10"><div class="mtb20 c666 tac">暂无数据</div></td></tr>
			</#if>
		</tbody>
	</table>
	<@include file="/common/pagination" />
</div>
</@master>
<@js>
	(function(){
		$("#catagory").change(function(){
			var catagory = $.trim($("#catagory").val());
			if(catagory.length > 0){
				$.ajax({
		            type:"GET",
		            url:"/wf/getProccessType",
		            data:{"catagory":catagory},
		            datatype:"json",
		            success:function(data){
		            	var processTypeHtml = new Array('<option value="">--请选择--</option>');
		           		$.each(data.data, function(i, item){  
		           			   processTypeHtml.push('<option value="'+item.code+'">'+item.name+'</option>'); 
					　　	});
						var processTypeObj = $("#processType");
						processTypeObj.empty();
						processTypeObj.html(processTypeHtml.join(''));
		            }       
     			});
			}else{
				var processTypeHtml = new Array('<option value="">--请选择--</option>');
				var processTypeObj = $("#processType");
				processTypeObj.empty();
				processTypeObj.html(processTypeHtml.join(''));
			}
		});
	})();
</@js>
<@jsRender/>